//
//  MyPersonalcentersetupViewController.m
//  Gxj
//
//  Created by 💋索少杰 on 2017/9/19.
//  Copyright © 2017年 wkq. All rights reserved.
//

#import "MyPersonalcentersetupViewController.h"
#import "MyPersonalcentersetupView.h"
#import "MainViewFromViewController.h"

@interface MyPersonalcentersetupViewController ()
{
    MyPersonalcentersetupView * personalCenter;
}

@end

@implementation MyPersonalcentersetupViewController
//导航条
- (void)viewWillAppear:(BOOL)animated
{
    self.navigationController.navigationBar.hidden = NO;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor=[UIColor whiteColor];

    //View设置
    [self setPersonalCentersetUpView];
}

- (void)setPersonalCentersetUpView{
    
    personalCenter=[[MyPersonalcentersetupView alloc] initWithFrame:self.view.frame];
    self.title = @"个人中心";
    self.view.backgroundColor = [UIColor whiteColor];
    self.automaticallyAdjustsScrollViewInsets = NO;
    self.navigationController.navigationBar.translucent = YES;
    //    self.navigationController.navigationBar.tintColor = [UIColor whiteColor];
    self.navigationController.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName:[UIColor whiteColor],NSFontAttributeName:[UIFont boldSystemFontOfSize:17]};
    [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"bg"]forBarMetrics:UIBarMetricsDefault];
    //返回按钮
    UIButton * leftBtn = [UIButton buttonWithType:UIButtonTypeSystem];
    leftBtn.frame = CGRectMake(0, 0, kWidthScale(15),kHeightScale(20));
    [leftBtn setBackgroundImage:[UIImage imageNamed:@"fanhui1"] forState:UIControlStateNormal];
    [leftBtn addTarget:self action:@selector(leftBarBtnClicked:) forControlEvents:UIControlEventTouchUpInside];
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithCustomView:leftBtn];
    [self.view addSubview:personalCenter];
}
- (void)leftBarBtnClicked:(UIButton *)btn
{
    [self.navigationController popViewControllerAnimated:YES];
}

#pragma mark - 点击空白回收键盘
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
    [self.view endEditing:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
